#pragma once
#include "afxwin.h"
#include "TEX0_SDK.h"
#include "afxcmn.h"

class CTEX0_Sheet;

// CTEX0_CallPage dialog

class CTEX0_CallPage : public CPropertyPage
{
	DECLARE_DYNAMIC(CTEX0_CallPage)

public:
	CTEX0_CallPage();
	virtual ~CTEX0_CallPage();

// Dialog Data
	enum { IDD = IDD_DLG_CALL_PAGE };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

private:
	CTEX0_Sheet* m_sheet;
	int m_siteHandle;
	int m_hangupFlag;
	vector<pair<string,vector<string>>> m_callTypeList;
	vector<CallRecord> m_callRecords;

	CComboBox m_circuitType;
	CComboBox m_rate;
	CString m_siteNmae;
	CListCtrl m_callRecList;
	vector <char *>  m_recordsName;

public:
	int getHangupState();
	int setHangupState(int hangupState);
	virtual BOOL OnInitDialog();
	void SetSheet(CTEX0_Sheet* sheet) {m_sheet = sheet;}
	void SetCallHandle(int handle) {m_siteHandle = handle;}
	afx_msg void OnCbnSelchangeComboCircuitType();
	afx_msg void OnBnClickedButtonCallSite();
	afx_msg void OnBnClickedButtonHangup();
	afx_msg void OnBnClickedButtonRefreshCallRecords();
	afx_msg void OnNMClickListCallRecords(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedButtonAddressBook();
};
